package k1_jdbc.demo01;


import k1_jdbc.tool.Const;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;

public class DBMetaData {

    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection conn = DriverManager.getConnection(Const.URL_TEST,Const.USERNAME,Const.PASSWORD);

        DatabaseMetaData dbmd = conn.getMetaData();

        System.out.println(dbmd.getURL());
        System.out.println(dbmd.getUserName());
        System.out.println(dbmd.isReadOnly());
        System.out.println(dbmd.getDatabaseProductName());
        System.out.println(dbmd.getDatabaseProductVersion());
        System.out.println(dbmd.getDriverName());
        System.out.println(dbmd.getDriverVersion());

        conn.close();

    }

}
